import Vue from "vue";
import VueRouter from "vue-router";
Vue.use(VueRouter);

const router = new VueRouter({
  routes: [
    {
      path: "/",
      redirect: "/storecoupons"
    },
    {
      path: "/storecoupons",
      components: {
        default: () => import("../views/StoreCoupons")
      },
			meta:{
			  title:'优惠券管理'
			},
    },
    {
      path: "/storecouponsDetail",
      components: {
        default: () => import("../views/StoreCouponsDetail")
      },
			meta:{
			  title:'优惠券详情'
			},
    },
    {
      path: "/operationflow",//主营业务
      components: {
        default: () => import("../views/OperationFlow")
      },
			meta:{
			  title:'营业流水'
			},
    },
		{
		  path: "/details",//主营业务
		  components: {
		    default: () => import("../views/OperationFlow/details.vue")
		  },
			meta:{
			  title:'工单详情'
			},
		},
		{
		  path: "/big",//大转盘
		  components: {
		    default: () => import("../views/LuckyDraw")
		  },
			meta:{
			  title:'幸运大转盘'
			},
		}
  ],
	// mode: 'history',
	base: '/storecoupons/'
});
router.afterEach((to, from, next) => {
  window.scrollTo(0, 0);
});
export default router;
